﻿/*-----------------------------------------------
// File: BattleProjectile.cs 
// Description: 
// Author: Shaobing	492057342@qq.com
-----------------------------------------------*/
using UnityEngine;
using System.Collections;

namespace Battle.View
{
    //public class BattleProjectile : MonoBehaviour
    //{
    //    public ProjectileData projResData;
    //    public ProjectileFlyType projFlyType {
    //        get {
    //            return projResData.projFlyType;
    //        }
    //    }
    //    public float flyTime {
    //        get { return projResData.projFlyTime; }
    //    }
    //    public Vector3 initOffset {
    //        get { return projResData.initOffset; }
    //    }

    //    public BattleCharacter creator;
    //    public BattleSkill creatorSkill;
    //    public BattleSkillRelease creatorSkillRelease;
    //    public int targetFPId;
    //    public BattleCamp targetCamp;

    //    public void Init(ProjectilePacket pp) {
    //        projResData = pp.projectileData;
    //        creator = BattleViewCtrl.GetInstance().GetBattleCharacter(pp.sourceUid);
    //        creatorSkill = creator.GetSkill(pp.skillType);
    //        creatorSkillRelease = creatorSkill.GetSkillRelease(pp.releaseId);
    //        targetFPId = pp.targetFPId;
    //        targetCamp = pp.targetCamp;
    //    }

    //    public void Shoot() {
    //        Invoke("TimeUp", flyTime);
    //        Shoot0();
    //    }

    //    protected virtual void Shoot0() {

    //    }

    //    public virtual void Tick() { }

    //    private void TimeUp() {
    //        OnCollider();
    //    }

    //    void OnCollider() {
    //        BattleViewCtrl.GetInstance().UnSpawnProjectile(this);
    //    }

    //    void OnColliderCallBack(ResponseBase rb) {
    //        var attackPackage = rb.packageData as OnceAttackPackage;
    //        if (attackPackage == null)
    //        {
    //            Debug.LogError("[BCAttackState OnSkillReleaseCallBack] Response Not Have OnceAttackPackage. TYPE:" + rb.packageData.GetType().ToString());
    //            return;
    //        }
    //        attackPackage.NormalDeal();

    //    }
    //}
}
